Skip to content

feat: auto-fetch head-ref from GitHub Actions in detached HEAD state#2805

Merged
runningcode merged 1 commit intomasterfrom
feat/auto-fetch-head-ref-github-actions
Sep 29, 2025
Merged

feat: auto-fetch head-ref from GitHub Actions in detached HEAD state#2805
runningcode merged 1 commit intomasterfrom
feat/auto-fetch-head-ref-github-actions

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Sep 29, 2025

Summary

  • Add get_github_head_ref() function to automatically detect head branch from GitHub Actions environment variables
  • Integrate with upload command fallback chain to resolve detached HEAD scenarios
  • Use GITHUB_HEAD_REF for automatic head-ref detection in PR workflows

See context reference: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts

Context

Resolves EME-367 - Auto-fetch correct head-ref value in detached HEAD state using GitHub Actions env variables. Follows the same pattern as recent work on base SHA auto-fetching (#2799).

🤖 Generated with Claude Code


Note

Adds get_github_head_ref() (reads GITHUB_HEAD_REF in pull_request) and makes build upload prefer it before git head ref to handle detached HEAD.

  • Build Upload:
    • Update src/commands/build/upload.rs head-ref resolution to first use get_github_head_ref(); fall back to git_repo_head_ref.
  • VCS Utils:
    • Add get_github_head_ref() to read GITHUB_HEAD_REF when GITHUB_EVENT_NAME is pull_request with debug logging.
    • Export and import updated in utils::vcs and upload command.

Written by Cursor Bugbot for commit 332fe76. This will update automatically on new commits. Configure here.

@linear
Copy link
Copy Markdown

linear bot commented Sep 29, 2025

Add `get_github_head_ref()` function to automatically detect head branch
from GitHub Actions environment variables when running in PR workflows.
This resolves detached HEAD scenarios by using GITHUB_HEAD_REF instead
of requiring manual --head-ref specification.

Resolves EME-367

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@runningcode runningcode force-pushed the feat/auto-fetch-head-ref-github-actions branch from 59c1f46 to 332fe76 Compare September 29, 2025 07:29
@runningcode runningcode marked this pull request as ready for review September 29, 2025 08:13
@runningcode runningcode requested review from a team and szokeasaurusrex as code owners September 29, 2025 08:13
@runningcode runningcode merged commit 268f375 into master Sep 29, 2025
42 of 44 checks passed
@runningcode runningcode deleted the feat/auto-fetch-head-ref-github-actions branch September 29, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants